'use strict';
var app = angular.module('ionicApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider) {

	$stateProvider
		.state('eventmenu', {
			url: "/event",
			abstract: true,
			templateUrl: "templates/event-menu.html"
		})
		.state('eventmenu.home', {
			url: "/home",
			views: {
				'menuContent': {
					templateUrl: "templates/home.html"
				}
			}
		})
		.state('eventmenu.chemistry', {
			url: "/chemistry",
			views: {
				'menuContent': {
					templateUrl: "coms/quiz/subject.html"
//					controller: "CheckinCtrl"
				}
			}
		})
		.state('quiz', {
			url: '/quiz',
			templateUrl: 'coms/quiz/quiz.html',
			controller: 'quizCtrl'
		})
		//.state('main', {
		//  url: '/main',
		//  templateUrl: 'templates/main.html',
		//  controller: 'MainCtrl'
		//});

	$urlRouterProvider.otherwise("/event/home");
})

.run(['quizData', '$rootScope',
	function(quizData, $rootScope) {
		//查看url 当前用户是否登录
		// quizData.getQuizData();
	}
])

.controller('MainCtrl', function($scope, $state) {
	console.log('MainCtrl');

	$scope.toIntro = function() {
		$state.go('intro');
	}
});